import React, { PureComponent } from "react";
// 具名插槽
const Son = function (props) {
  return (
    <div>
      {props.hz}
      {props.hx}
      {props.hc}
    </div>
  );
};
// 匿名插槽
const Son2 = function (props) {
  return (
    <div>
      {props.children[0]}
      {props.children[1]}
      {props.children[2]}
    </div>
  );
};

class index extends PureComponent {
  render() {
    const hz = <div>123</div>;
    const hx = <div>456</div>;
    const hc = <div>789</div>;
    return (
      <div>
        <Son hz={hz} hx={hx} hc={hc}></Son>
        <Son2>
          {hz}
          {hx}
          {hc}
        </Son2>
      </div>
    );
  }
}

export default index;
